package com.example.springboottest.example.annotation;

import java.lang.annotation.Annotation;

public class AnnotationTest {
    public static void main(String[] args) {
        MyTagObject object = new MyTagObject();
        Annotation[] annotationArr = object.getClass().getAnnotations();
        for (Annotation annotation : annotationArr) {
            System.out.println(annotation.toString());
            if (annotation instanceof MyTag) {
                System.out.println(((MyTag) annotation).age());
                System.out.println(((MyTag) annotation).name());
            }
        }
    }
}
